home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group00b.txt / 000136_icon-group-sender_Wed Nov 1 13:31:13 2000.msg < prev    next >
Internet Message Format  |  2001-01-03  |  1KB

  1. Return-Path: <icon-group-sender>
  2. Received: (from root@localhost)
  3.     by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id eA1KTjf17206
  4.     for icon-group-addresses; Wed, 1 Nov 2000 13:29:45 -0700 (MST)
  5. Message-Id: <200011012029.eA1KTjf17206@baskerville.CS.Arizona.EDU>
  6. Date: Wed, 01 Nov 2000 13:59:58 -0600
  7. From: Carl Sturtivant <carl@elegantus.com>
  8. X-Accept-Language: en
  9. To: Icon Group <icon-group@cs.arizona.edu>
  10. Subject: Re: How would the experts handle this...??
  11. Errors-To: icon-group-errors@cs.arizona.edu
  12. Status: RO
  13. Content-Length: 786
  14.  
  15. Here's how I'd do this:
  16.  
  17. procedure main()
  18.   port := table(''); starboard := table('')
  19.   while line := read() do {
  20.     reverse(line) ? while port[move(1)] ++:= move(1) do move(-1)
  21.     line ? while starboard[move(1)] ++:= move(1) do move(-1)
  22.   }
  23.   every ch := !&cset do {
  24.     pchars := port[ch]; schars := starboard[ch]
  25.     if *(pchars ++ schars) > 0 then
  26.       write(image(ch), ":\t", image(pchars), ", ",  image(schars))
  27.   }
  28. end
  29.  
  30. Carl Sturtivant
  31.  
  32. symbiot@my-deja.com wrote:
  33.  
  34. > I wish to scan thru a file and determine how letters "connect" with
  35. one
  36. > another. By that I mean that for every letter of the alphabet, I would
  37.  
  38. > like to compile two lists: one containing all the letters which apper
  39. > to the right of the given letter, and another for all those appearing
  40. > to the left.
  41.  
  42.  
  43.  
  44.